package com.bqtv.sport.ui.mine

import android.content.Context
import android.content.Intent
import android.view.View
import com.bqtv.sport.app.AppActivity
import com.bqtv.sport.databinding.ActivityPointsMallRulesBinding
import com.bqtv.sport.databinding.ActivityWithdrawnBinding
import com.bqtv.sport.dialog.SelectAddressDialog
import com.bqtv.sport.dialog.SelectBankDialog
import com.bqtv.sport.dialog.WithdrawnDialog

class WithdrawnActivity : AppActivity<ActivityWithdrawnBinding>() {
    companion object {
        fun start(context: Context) {
            val intent = Intent(context, WithdrawnActivity::class.java)
            context.startActivity(intent)
        }
    }

    override fun getViewBinding() = ActivityWithdrawnBinding.inflate(layoutInflater)

    override fun initView() {

    }

    override fun initData() {


        initListener()
    }

    private fun initListener() {
        setOnClickListener(binding.tvWithdrawn,binding.llBank)
    }

    override fun onClick(view: View) {
        super.onClick(view)
        when (view) {
            binding.tvWithdrawn -> {
                var dialog = WithdrawnDialog.Builder(this)
                dialog.clickResult = object : WithdrawnDialog.Builder.ClickResult {
                    override fun onPswResult(string: String) {

                    }
                }
                dialog.show()
            }
            binding.llBank -> {
                var bankDialog = SelectBankDialog.Builder(this)
                bankDialog.clickResult = object : SelectBankDialog.Builder.ClickResult {
                    override fun onAddClick() {
                        addBankCard()
                    }

                    override fun onItemClick() {

                    }
                }
                bankDialog.show()
            }

        }
    }
    private fun addBankCard() {
        AddBankCardActivity.start( this)
    }
}